home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-ststio.ads < prev    next >
Text File  |  1994-05-19  |  5KB  |  124 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                A D A . S T R E A M S . S T R E A M _ I O                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26. with Ada.IO_Exceptions;
  27.  
  28. package Ada.Streams.Stream_IO is
  29.  
  30.    pragma Unimplemented_Unit;
  31.  
  32.    type Stream_Access is access Root_Stream_Type'Class;
  33.  
  34.    type File_Type is limited private;
  35.  
  36.    type File_Mode is (In_File, Out_File, Append_File);
  37.  
  38.    type    Count          is range 0 .. Long_Long_Integer'Last;
  39.    subtype Positive_Count is Count range 1 .. Count'Last;
  40.  
  41.    ---------------------
  42.    -- File Management --
  43.    ---------------------
  44.  
  45.    procedure Create (File : in out File_Type;
  46.                      Mode : in File_Mode := Out_File;
  47.                      Name : in String := "";
  48.                      Form : in String := "");
  49.  
  50.    procedure Open   (File : in out File_Type;
  51.                      Mode : in File_Mode;
  52.                      Name : in String;
  53.                      Form : in String := "");
  54.  
  55.    procedure Close  (File  : in out File_Type);
  56.    procedure Delete (File : in out File_Type);
  57.    procedure Reset  (File  : in out File_Type; Mode : in File_Mode);
  58.    procedure Reset  (File  : in out File_Type);
  59.  
  60.    function Mode    (File : in File_Type) return File_Mode;
  61.    function Name    (File : in File_Type) return String;
  62.    function Form    (File : in File_Type) return String;
  63.  
  64.    function Is_Open (File : in File_Type) return Boolean;
  65.  
  66.    function Stream  (File : in File_Type) return Stream_Access;
  67.  
  68.    -----------------------------
  69.    -- Input-Output Operations --
  70.    -----------------------------
  71.  
  72.    procedure Read (
  73.      File : in File_Type;
  74.      Item : out System.Storage_Elements.Storage_Array;
  75.      Last : out System.Storage_Elements.Storage_Offset;
  76.      From : in Positive_Count);
  77.  
  78.    procedure Read (
  79.      File : in File_Type;
  80.      Item : out System.Storage_Elements.Storage_Array;
  81.      Last : out System.Storage_Elements.Storage_Offset);
  82.  
  83.    procedure Write (
  84.      File : in File_Type;
  85.      Item : in System.Storage_Elements.Storage_Array;
  86.      To   : in Positive_Count);
  87.  
  88.    procedure Write (
  89.      File : in File_Type;
  90.      Item : in System.Storage_Elements.Storage_Array);
  91.  
  92.    ----------------------------------------
  93.    -- Operations on Position within File --
  94.    ----------------------------------------
  95.  
  96.    procedure Set_Index  (File : in File_Type; To : in Positive_Count);
  97.  
  98.    function Index       (File : in File_Type) return Positive_Count;
  99.    function Size        (File : in File_Type) return Count;
  100.  
  101.    function End_Of_File (File : in File_Type) return Boolean;
  102.  
  103.    procedure Set_Mode   (File : in out File_Type; Mode : in File_Mode);
  104.  
  105.    procedure Flush      (File : in out File_Type);
  106.  
  107.    ----------------
  108.    -- Exceptions --
  109.    ----------------
  110.  
  111.    Status_Error : exception renames IO_Exceptions.Status_Error;
  112.    Mode_Error   : exception renames IO_Exceptions.Mode_Error;
  113.    Name_Error   : exception renames IO_Exceptions.Name_Error;
  114.    Use_Error    : exception renames IO_Exceptions.Use_Error;
  115.    Device_Error : exception renames IO_Exceptions.Device_Error;
  116.    End_Error    : exception renames IO_Exceptions.End_Error;
  117.    Data_Error   : exception renames IO_Exceptions.Data_Error;
  118.  
  119. private
  120.    --  Dummy definition (body not writen yet) ???
  121.  
  122.    type File_Type is new Integer;
  123. end Ada.Streams.Stream_IO;
  124.